<?php

namespace Trawind\AliOSS\Plugins;
use Faker\Core\File;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Storage;
use League\Flysystem\Config;
use League\Flysystem\Plugin\AbstractPlugin;
use League\Flysystem\Util;

class ListObjects extends AbstractPlugin
{

    /**
     * Get the method name.
     *
     * @return string
     */
    public function getMethod()
    {
        return 'listObjects';
    }

    public function handle($directory, $recursive){

        $directory = Util::normalizePath($directory);
        return $this->filesystem->getAdapter()->listContents($directory, $recursive);
    }
}
